/*
   ==============================================================================

   Virtual MIDI Keyboard
   Copyright 2007 by Prashant Vaibhav

   ==============================================================================
   */

#include <juce/juce.h>
#include "VmkDisplay.h"

using namespace std;

class mainWindow : public DocumentWindow
{
  private:
		VmkDisplay* m_Vmk;

  public:
	mainWindow() : DocumentWindow (T("Virtual MIDI Keyboard"), Colours::lightgrey, DocumentWindow::minimiseButton | DocumentWindow::closeButton, true) {
			m_Vmk = new VmkDisplay();
      setContentComponent(m_Vmk);
      //setUsingNativeTitleBar(true);
      setVisible (true);
      centreWithSize (696, 230);
      DBG("Displayed the main window");
    }

    void closeButtonPressed() {
      // Close the app
      JUCEApplication::quit();
    }
};


// Now the JUCE Application class
class VirtualKeyboardApplication : public JUCEApplication
{
  private:
    mainWindow* m_MainWindow;

  public:
    void initialise(const String& commandLine) {
      // just create the main window...
      m_MainWindow = new mainWindow();
    }

    void shutdown() {
      // clear up..

      if (m_MainWindow != 0)
        delete m_MainWindow;
    }

    const String getApplicationName() {
      return T("Virtual MIDI Keyboard");
    }

    const String getApplicationVersion() {
      return T("0.1");
    }

    bool moreThanOneInstanceAllowed() {
      return true;
    }
};

START_JUCE_APPLICATION (VirtualKeyboardApplication)
